﻿@model Banking.Domain.Person
           
@using Banking.Web
    
<tr data-entity="person" data-view="view" data-id=@Model.ID>
    <td><input type="checkbox" class="itemCheck" data-action="select"/></td>
    <td><span data-sort-key="name" title="Go to @Model.Name's page">@Html.ActionLink(Model.Name, "ViewHistory", new { name = Model.Name })</span></td>
    <td><span data-action="edit" data-sort-key="balance" title="Edit person @Model.Name">@Model.GetBalance().ToString(Helper.DecimalFormat)</span></td>
    <td>
        <div data-sort-key="deals" data-sort-value=@Model.Operations.Count class="personDeals">
            <ul>
                @foreach (var operation in Model.Operations)
                {
                    @Html.Action("ViewTitle", "Operation", new { id = operation.ID })
                    if (Model.Operations.Last() != operation) { Write(","); }
                }
            </ul>
        </div>
    </td>
</tr>

